 <#include "../../common/com.html"/> <@layout>
<!-- ace styles -->

<script type="text/javascript">
var urls="";
    /**
     * 新增
     */
    function saveModel() {
        var id=document.getElementById("id").value;
              if(Validator.Validate(document.getElementById('forma'))){
        } else {
            return;
        }
        
        var url = '';
        if(id==""){
            url = '${ctx}/dmCjgl/save';
        }     else{
            url = '${ctx}/dmCjgl/update';
        }
        $('#forma').form('submit', {
            url : url,
            onSubmit : function() {
                return $(this).form('validate');
            },
            success : function(data) {
                alert(data);
                window.location.href='${ctx}/dmCjgl';
            }
        });
    }
</script>
<div class="page-content">
	<div class="row-fluid">
		<div class="span12">
			<form class="form-horizontal" id="forma" method="post">
				<input type="hidden" name="id" id="id">
				<div class="control-group">
					<label class="control-label">厂家名称:</label>
					<div class="controls">
						<input id="cjmc" name="cjmc" type="text" dataType="Require"
							msg="请输入厂家名称" style="min-height: 24px;" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">联系人:</label>
					<div class="controls">
						<input id="lxr" name="lxr" type="text" style="min-height: 24px;" />
					</div>
				</div>

				<div class="control-group">

					<label class="control-label">联系电话:</label>
					<div class="controls">
						<input id="lxdh" name="lxdh" type="text" style="min-height: 24px;" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">微信号:</label>
					<div class="controls">
						<input id="wx" name="wx" type="text" style="min-height: 24px;" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">地址:</label>
					<div class="controls">
						<input id="fhdz" name="fhdz" type="text" style="min-height: 24px;" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">备注:</label>
					<div class="controls">
						<input id="bz" name="bz" type="text" style="min-height: 24px;" />
					</div>
				</div>
				<div class="control-group content">
					<div class="controls">

						<a class="btn btn-info btn-small" onclick="saveModel()">确定
						</a> &nbsp; &nbsp;&nbsp;&nbsp; <a 
							class="btn btn-danger btn-small bigger-110"
							onclick="window.location.href='${ctx}/dmCjgl'">取消 </a>
					</div>
				</div>
			</form>
		</div>
	</div>
	</div>
</body>

<script>
    	 /**
    * 修改页面使用
    */
  
 <#list newlist as m>
        document.getElementById("cjmc").value  =  '${(m.cjmc)!}';
        document.getElementById("lxr").value  =  '${(m.lxr)!}';
        document.getElementById("lxdh").value  =  '${(m.lxdh)!}';
        document.getElementById("wx").value  =  '${(m.wx)!}';
        document.getElementById("fhdz").value  =  '${(m.fhdz)!}';
        document.getElementById("bz").value  =  '${(m.bz)!}';
        document.getElementById("id").value  =  '${(m.id)!}';

</#list>
    </script>
</@layout>
